//
//  BLTagView.h
//  qbo
//
//  Created by iBenz on 16/12/22.
//  Copyright © 2016年 QBO. All rights reserved.
//

#import <UIKit/UIKit.h>
@class BLTagView, BLTag;


@protocol BLTagViewDelegate <NSObject>
@optional
- (void)tagView:(BLTagView *)tagView didSelectedTag:(BLTag *)tag;
- (void)tagView:(BLTagView *)tagView deselectedTag:(BLTag *)tag;
@end

@interface BLTagView : UIView
@property(nonatomic, assign) UIEdgeInsets edgeInsets;
@property(nonatomic, assign) CGFloat lineSpacing; // default is 12
@property(nonatomic, assign) CGFloat rowSpacing;  // default is 12
@property(nonatomic, strong) NSArray<BLTag *> *tags;
@property(nonatomic, weak)   id<BLTagViewDelegate> delegate;
@end


@interface BLTag : UIButton {
    @package
    CALayer *_border;
}
@property(nonatomic, readonly) NSString *title;
@property(nonatomic, strong) UIColor *color;
@property(nonatomic, strong) UIColor *selectedColor;
@property(nonatomic, assign) CGFloat cornerRadius;

+ (instancetype)tagWithTitle:(NSString *)title;

@end
